import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Stage1 here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Stage1 extends World
{

    Node[][] node = new Node[8][8];
    
    Kabayan k1 = new Kabayan();
    Rock r1 = new Rock();
    Rock r2 = new Rock();
    Rock r3 = new Rock();
    Rock r4 = new Rock();
    Spider s1 = new Spider();
    
    /**
     * Constructor for objects of class Stage1.
     * 
     */
    public Stage1()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        //super(600, 400, 1); 
        super(8, 8, 60); 

        for(int i=0; i<8; i++){
            for(int j=0; j<8; j++){
                node[i][j] = new Node();
                addObject(node[i][j], i, j);
            }
        }
        prepare();
        populate();
    }

    /**
     * Prepare the world for the start of the program. That is: create the initial
     * objects and add them to the world.
     */
    private void prepare()
    {
    }
    
    /**
     * Populate the world with a fixed scenario of wombats and leaves.
     */    
    public void populate()
    {
        
        addObject(k1, 4, 6);
        
        addObject(r1, 2, 4);        
        addObject(r2, 3, 4);
        addObject(r3, 4, 4);
        addObject(r4, 5, 4);
        
        addObject(s1, 4, 0);

    }
    
    public void act()
    {
        System.out.println("coy!");
        s1.setLocation(s1.getX(), s1.getY() + 1);
        
    }
}
